package com.zhang.controller;

import com.zhang.entity.response.ResponseResult;
import com.zhang.util.ToPython;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.server.PathParam;

/**
 * User: 张
 * Date: 2024-11-05
 * Time: 15:10
 * Description:
 */

@RestController("/device")
public class DeviceController {

    @Autowired
    private ToPython toPython;

//    @RequestMapping("/hello")
//    public ResponseResult<String> Hello(){
//        return ResponseResult.success("hello");
//    }
//
//    @RequestMapping("/init")
//    public ResponseResult<String> Init() throws Exception {
//        return ResponseResult.success(toPython.Init());
//    }
//    @RequestMapping("/check_material")
//    public ResponseResult<String> CheckMaterial() throws Exception {
//        return ResponseResult.success(toPython.CheckMaterial());
//    }
//    @RequestMapping("/control_conveyor_belt")
//    public ResponseResult<String> ControlConveyorBelt(@PathParam("direction") String direction,
//                                                      @PathParam("start") String start) throws Exception {
//        return ResponseResult.success(toPython.ControlConveyorBelt(direction,start));
//    }
//    @RequestMapping("/control_light")
//    public ResponseResult<String> ControlLight(@PathParam("red") Integer red,
//                                               @PathParam("yellow") Integer yellow,
//                                               @PathParam("green") Integer green,
//                                               @PathParam("brightness")Integer brightness) throws Exception {
//        return ResponseResult.success(toPython.ControlLight(red,yellow,green,brightness));
//    }
//    @RequestMapping("/control_buzzer")
//    public ResponseResult<String> ControlBuzzer(@PathParam("buzzer_on") String buzzer_on) throws Exception {
//        return ResponseResult.success(toPython.ControlBuzzer(buzzer_on));
//    }
//    @RequestMapping("/push_material")
//    public ResponseResult<String> PushMaterial() throws Exception {
//        return ResponseResult.success(toPython.PushMaterial());
//    }
//    @RequestMapping("/run_conveyor_belt")
//    public ResponseResult<String> RunConveyorBelt() throws Exception {
//        return ResponseResult.success(toPython.RunConveyorBelt());
//    }
//    @RequestMapping("/set_axis_speed")
//    public ResponseResult<String> SetAxisSpeed(@PathParam("axis") String axis,
//                                               @PathParam("speed") String speed) throws Exception {
//        return ResponseResult.success(toPython.SetAxisSpeed(axis,speed));
//    }
//    @RequestMapping("/move_axis_to_origin")
//    public ResponseResult<String> MoveAxisToOrigin(@PathParam("buzzer_on") String buzzer_on) throws Exception {
//        return ResponseResult.success(toPython.MoveAxisToOrigin(buzzer_on));
//    }
//    @RequestMapping("/move_axis")
//    public ResponseResult<String> ControlLight(@PathParam("axis") String axis,
//                                               @PathParam("direction") String direction,
//                                               @PathParam("material_action") String material_action) throws Exception {
//        return ResponseResult.success(toPython.MoveAxis(axis,direction,material_action));
//    }
//    @RequestMapping("/stop_axis")
//    public ResponseResult<String> StopAxis(@PathParam("buzzer_on") String buzzer_on) throws Exception {
//        return ResponseResult.success(toPython.StopAxis(buzzer_on));
//    }
//    @RequestMapping("/toggle_switches")
//    public ResponseResult<String> ToggleSwitches() throws Exception {
//        return ResponseResult.success(toPython.ToggleSwitches());
//    }
//    @RequestMapping("/control_axis_position")
//    public ResponseResult<String> ControlAxisPosition(@PathParam("axis") String x_pulse,
//                                                      @PathParam("speed") String y_pulse) throws Exception {
//        return ResponseResult.success(toPython.ControlAxisPosition(x_pulse,y_pulse));
//    }
//    @RequestMapping("/read_axis_position")
//    public ResponseResult<String> ReadAxisPosition(@PathParam("axis") String axis) throws Exception {
//        return ResponseResult.success(toPython.ReadAxisPosition(axis));
//    }
//    @RequestMapping("/get_conveyor_status")
//    public ResponseResult<String> GetConveyorStatus() throws Exception {
//        return ResponseResult.success(toPython.GetConveyorStatus());
//    }

}

